<?php 
    include 'cabecalho.php';
    
    if($nivel >=2 || $nivel == null){
        header("location: index.php");
    }
    if($_GET['idperg'] == null){
        header("location: cadpergunta-upd.php");
    }
    
     $objpergunta = new Pergunta();
     

     $idpergunta = $objpergunta->idpergunta = $_GET['idperg'];
     
     $itens = $objpergunta->retornarunico();
     

     
  

    

   
     
     
     
    if(isset($_POST['submit']) ){
        

        
        
        
        $objpergunta->pergunta_trad = $_POST["pergunta_trad"];;
        
        
        
        $objpergunta->atualizarpergunta();
        
       
       
       
        header("location: cadpergunta-upd.php?idperg= $itens->idpergunta");
       
       

    }

  ?>


<script type="text/javascript">
            $(document).ready(function(){
                
                
            });
            
         
                
                
                
                
        </script>
                
                <h1>Editar Pergunta</h1><br /><br />
                
                
                    
                
                <br />
                
                
               
                <div class="listaanterior">
                    <div class="botaoeditar"><a href="cadpergunta-upd.php?idperg=<?php echo $itens->idpergunta ?>" >Cancelar</a></div><br />
                PERGUNTA: <?php 
                echo filter_var($itens->pergunta_trad,FILTER_SANITIZE_SPECIAL_CHARS);
                ?>
                </div>
                
                
                
                
                
                
                <div class="formulario">
                    <form method="POST" action="cadpergunta-upd2.php?idperg=<?php echo $itens->idpergunta ?>" id="selecionar">
                       <br /><br /><br /><br />
                       <label >Pergunta:</label>
                        <textarea name="pergunta_trad" required maxlength="500" rows="11" cols="45"><?php echo $itens->pergunta_trad;?></textarea><br /><br />
                        <label ></label>
                        <input type="submit" name="submit" id="submit2" value="Confirmar"  ><br />
                    </form>
                
<?php 
    include 'rodape.php';
?>

               
               
		

  
